﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliBiliCSharpStudy.ch30.d07 {
    class HelloGeneric7 {
        public static void Demo() {
            Test2();
        }

        public static void Test2() {
            IDictionary<int, string> dict = new Dictionary<int, string>();
            dict[1] = "Timothy";
            dict[2] = "Michael";
            Console.WriteLine($"Student #1 is {dict[1]}");
            Console.WriteLine($"Student #2 is {dict[2]}");
        }

        public static void Test1() {
            IList<int> list = new List<int>();
            for (int i = 0; i < 20; i++) {
                list.Add(i);
            }
            foreach (var item in list) {
                Console.WriteLine(item);
            }
        }
    }
}
